home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 November / Chip_2000-11_cd2.bin / sharewar / Slunec / app / 17 / _SETUP.1 / Seznam oken.pw < prev    next >
Text File  |  2000-08-30  |  2KB  |  53 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {     Programmer's Wizard 2 Pascal Script               }
  5. {     (popis jazyka v souboru SCRIPT.DOC)               }
  6. {                                                       }
  7. {*******************************************************}
  8. uses ScriptUtils;
  9.  
  10. function GetVerStr: string;
  11. var
  12.   mMajor, mMinor, mRel: Integer;
  13. Begin
  14.   GetVersionEx(mMajor, mMinor, mRel);
  15.   result := 'v' + IntToStr(mMajor) + '.' + IntToStr(mMinor) + '.' +
  16.     IntToStr(mRel);
  17. end;
  18.  
  19. function GetValidVerStr: string;
  20. Begin
  21.   result := 'v2.0.1'; //pozadovana verze PW
  22. end;
  23.  
  24. var
  25.   mIndex: Integer;
  26.   mHandles: Array of LongInt;
  27.   mFiles: Array of String;
  28.   mS, mName: String;
  29.   mAnswer: Integer;
  30. Begin
  31.   if GetValidVerStr <> GetVerStr then //nespravna verze?
  32.     ShowMessage('Upozorn∞nφ: tento skript byl napsßn pro Programmers Wizard ' +
  33.       GetValidVerStr + '. Momentßln∞ spuÜt∞nß verze: ' + GetVerStr);
  34.  
  35.   //vytvorit snapshot woken
  36.   EnumWindows(mHandles);
  37.   SetArrayLength(mFiles, GetArrayLength(mHandles));
  38.  
  39.   //prevest na citelnejsi retezec
  40.   for mIndex := 0 to GetArrayLength(mHandles) - 1 do Begin
  41.     WindowToPluginEntryID(mHandles[mIndex], mS);
  42.     PluginEntryIDToName(mS, mName);
  43.     WindowToFileName(mHandles[mIndex], mS);
  44.     mFiles[mIndex] := ExtractFileName(mS) + ' [' + mName + ']';
  45.   end;
  46.  
  47.   //zobrazit dialog se seznamem nalezenych woken
  48.   mAnswer := ShowListDialog('Dokumenty', 'Prßv∞ otev°enΘ dokumenty:', mFiles);
  49.   if mAnswer <> -1 then
  50.     BringWindowToTop(mHandles[mAnswer]); //a prenest dopredu
  51. end.
  52.  
  53.